<template>
  <div class="container page">

    <!-- <p style="text-align:center;margin-top:300rpx;" @click="a">首页</p> -->

    <div>

<swiper class="swiper" style="width:100%;height:480rpx;" autoplay="true" circular="true" interval="5000" duration="1000">
    <block v-for="(item, index) in movies" :index="index" :key="key">
        <swiper-item>
            <!-- <image :src="item.url" class="slide-image" mode="aspectFill"/> -->
            <image :src="item.url" style="width:100%;height:480rpx;" mode="aspectFill"/>
        </swiper-item>
    </block>
</swiper>
        <!-- <ul><img src="https://www.hatchdo.com/wxmini/Index/index1.png" class="sy1" style="height: 500rpx" /></ul>
        <p style="margin:40rpx 0"></p> -->

<div style="margin:30rpx;">
<p>感受老艺术家艺术氛围的<span style="font-size:40rpx;color:#8A5B57">熏陶</span></p>
<p>专门为4到12岁的<span style="font-size:40rpx;color:#8A5B57">儿童</span> 定制小提琴启蒙教育</p>
<p>注重<span style="font-size:40rpx;color:#8A5B57">兴趣及乐感</span> 的培养,非填鸭式教学</p>
</div>

  
        <p style="margin:40rpx 0"></p>
<div  style="margin:0 80rpx">
        <video id="myVideo" src="https://www.hatchdo.com/h5/img/2.0/m-ProductCenter/chanping.mp4"></video>

        <video id="myVideo" src="https://www.hatchdo.com/h5/img/2.0/m-ProductCenter/chanping.mp4"></video>

</div>

        <!-- <ul style="padding:0 30rpx"><img src="https://www.hatchdo.com/wxmini/Index/shouye3.png" class="sy1" style="height: 150rpx;" /></ul>
        <p style="margin:20rpx 0"></p> -->
        <!-- <ul style="padding:0 30rpx"><img src="https://www.hatchdo.com/wxmini/Index/shouye4.png" class="sy1" style="height: 30rpx;" /></ul>
        <p style="margin:20rpx 0"></p>
        <ul style="padding:30rpx"><img src="https://www.hatchdo.com/wxmini/Index/shouye5.png" class="sy1" style="height: 500rpx;" /></ul>
        <p style="margin:140rpx 0"></p> -->
    </div>


  </div>
</template>
<script>
// var WXBizDataCrypt = require('@/tools/WXBizDataCrypt')
import {showSuccess, showModal} from '@/util'
import {get, post} from '@/util'
// import {get2, post2} from '@/server/api'
import config from '@/config'
export default {
  components: {
  },
  data () {
    return {
      movies:[
        // {'url':'https://www.hatchdo.com/wxmini/banner/1.png'},
        // {'url':'https://www.hatchdo.com/wxmini/banner/2.png'},
        // {'url':'https://www.hatchdo.com/wxmini/banner/3.png'},
        {'url':'https://www.hatchdo.com/wxmini/violin/timg.jpeg'},
        {'url':'https://www.hatchdo.com/wxmini/violin/timg-2.jpeg'}
      ],
      tabA: 0,
      productList: [],
      focus: true,
      inputValue: ''
    }
  },
  mounted () {
    this.userinfo = wx.getStorageSync('userinfo')
  },
  onShareAppMessage() {
    return {
      title: `老一辈纯粹主义艺术家...`,
      // imageUrl: 'https://www.rrjiaoyi.com/static/rr-min/share/share.png',
      path: `/pages/hcdindex/main?shareuser=${wx.getStorageSync('user').id}`
    }
  },
  methods: {
    productChoose (id) {
      // console.log(name, img, userId, accountId)
      wx.navigateTo({
        url: `/pages/product-detail/main?id=${id}`
      })
    },
    goSales(x){
      wx.navigateTo({
        url: `/pages/sales/main?sale=${x}`
      })
    },
    goShop(){
      wx.switchTab({
        url: `/pages/home/main`
      })
    },
    a() {
      wx.requestPayment(
      {
      // 'appId': 'wxa13b77d438fbf138',
      'timeStamp': '1563954884',
      'nonceStr': 'd4XYKlZkpJNY4GZiagAKzoTgYi7aRto0',
      'package': 'prepay_id=wx241554461048331ca6c0ab091510446800',
      'signType': 'MD5',
      'paySign': '61F3C1E4F3A32E2A16631B7190F3A42E',
      'success':function(res){
        console.log('成功')

      },
      'fail':function(res){
        console.log('失败')

      },
      'complete':function(res){
        console.log('完成')

      }
      })
    },
    chooseTab(x) {
      this.tabA = x;
      if(x === 0) {
        this.get_product("");
      } else {
        this.get_product(x);
      }
    },
    async get_product(categoryId) {
      return await get(`geweb/product/get_productlist?categoryId=${categoryId}`, {}).then(result => {
        console.log(result.res)
        this.productList = result.res;
      })
    },
    productChoose (id) {
      // console.log(name, img, userId, accountId)
      wx.navigateTo({
        url: `/pages/product-detail/main?id=${id}`
      })
    },
    async player() {
      return await post('minipro/List', {}, {'api':'all', 'page':1})
    },
    async demo() {
    // return await get2('demo', {})
    },
    async joke() {
      return await get2('api/jokes', {})
    },
    predict () {
      wx.navigateTo({
        url: '/pages/search/main'
      })
    },
    jumpClick (comment) {
      wx.navigateTo({
        // url: '/pages/web-view/main'
        url: '/pages/web-view/main?path=' + 'https://wj.qq.com/s/2491547/f457/'
        // url: '/pages/detail/main'
      })
    }

  },
  onShow () {
    // this.get_product("")
    // console.log('1',this.$root.$mp.query.scene)
    // console.log('query',this.$root.$mp.query)

    // console.log('2',decodeURIComponent(this.$root.$mp.query.scene))


    
    // if (decodeURIComponent(this.$root.$mp.query.scene).split("&id=")[0].split("shareid=")[1]) {
    //   wx.setStorageSync('scene', decodeURIComponent(this.$root.$mp.query.scene).split("&id=")[0])
    //   wx.setStorageSync('id', decodeURIComponent(this.$root.$mp.query.scene).split("&id=")[1])
    // }
    // console.log('scene',wx.getStorageSync('scene').split("shareid=")[1])


    // if(wx.getStorageSync('id') === decodeURIComponent(this.$root.$mp.query.scene).split("&id=")[1]){

    // console.log('11111')
    //     wx.setStorageSync('id','')
    //     this.productChoose(decodeURIComponent(this.$root.$mp.query.scene).split("&id=")[1])

    // } else {
    //   console.log('22222')

    // }
 
    // v1.0
    // if (decodeURIComponent(this.$root.$mp.query.scene).split("shareid=")[1]) {
    //   wx.setStorageSync('scene', decodeURIComponent(this.$root.$mp.query.scene))
    // }
    // console.log('scene',wx.getStorageSync('scene').split("shareid=")[1])
  }
}
</script>

<style scoped lang='scss'>
.container{
  font-size: 30rpx;
  // background-color: #BDCCD4;
}
page {
  // background-color: #BDCCD4;
  // background-color: #ffffff;
  width: 100%;
  height: 100%;
}
.section {
  text-align: center;
  margin-top: 200rpx;
  padding: 0 100rpx;
  display: flex;
  height: 80rpx;
  line-height: 80rpx;
}
.recomond {
  margin: 0 25rpx;
  margin-top: 25rpx;  
  height: 100rpx;
  line-height: 100rpx;
  text-align: center;
  display: flex;
  p {
    flex: 1;
  }
}
.choose {
  color: #44CFDC;
}

.productList {
  margin: 0 25rpx;
  margin-top: 50rpx;
  border: 1px solid #ddd;
  border-radius: 4px;
  height: 200rpx;
  // line-height: 200rpx;
  display: flex;
  text-align: center;
  div {
    flex: 1;
      img{
        width: 180rpx;
        height:180rpx;
        margin: 10rpx;
        // border-radius: 50%;
    }
  }
  .des{
    width: 400rpx;
    flex: 3;
    height: 200rpx;
    margin: 10rpx 30rpx;
    p {
      text-align: left;
      line-height: 60rpx;
    }
    .price {
      display: flex;
      span {
        flex: 1;
      }
    }
  }
}

.foot {
  color: rgb(45, 161, 187);
  text-align: center;
  margin-top: 200rpx;
}
.sy1{
    width: 100%
}
</style>
